/**
 * 
 */
package controllers;

import java.util.ArrayList;
import java.util.List;

import client.gui.panels.PanelIF;
import client.gui.panels.ReviewDecisionPanel;
import entities.Message;
import entities.MsgType;
import entities.ObjectType;

/**
 * @author Vodi
 * Review Decision Controller 
 */
public class ReviewDecisionController implements ControllerIF {

	
	/**
	 * the new request panel
	 */
	private ReviewDecisionPanel	reviewDecisionPanel;
	
	/**
	 * the main panel controller
	 */
	private ViewTicketController viewTicketController;
	
	public ReviewDecisionController(ViewTicketController viewTicketController) {
		this.viewTicketController = viewTicketController;
	}

	/* (non-Javadoc)
	 * @see controllers.ControllerIF#getPanel()
	 */
	@Override
	public PanelIF getPanel() {
		return reviewDecisionPanel;
	}

	/* (non-Javadoc)
	 * @see controllers.ControllerIF#setPanel(client.gui.panels.PanelIF)
	 */
	@Override
	public void setPanel(PanelIF panel) {
		this.reviewDecisionPanel = (ReviewDecisionPanel) panel;
	}

	/* (non-Javadoc)
	 * @see controllers.ControllerIF#action()
	 */
	@Override
	public void action() {
		List<String> params = new ArrayList<>();
		params.add(reviewDecisionPanel.getCommitteeDecision());
		params.add(reviewDecisionPanel.getCommitteeDecision());
		Message message = new Message(MsgType.SET_REVIEW_DECISION_REPORT_REQUEST, ObjectType.MIX_ARRAY, params);
		viewTicketController.sendMessage(message);
	}

	/* (non-Javadoc)
	 * @see controllers.ControllerIF#decipherMessage(entities.Message)
	 */
	@Override
	public void decipherMessage(Message message) {}

}
